package com.konne.nightmare.FastPublicOpinion.ui.information.fragment;

import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.LinearLayout;
import android.widget.PopupWindow;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.konne.nightmare.FastPublicOpinion.R;
import com.konne.nightmare.FastPublicOpinion.base.BaseMvpFragment;
import com.konne.nightmare.FastPublicOpinion.bean.MessageEvent;
import com.konne.nightmare.FastPublicOpinion.bean.UserInfoBean;
import com.konne.nightmare.FastPublicOpinion.http.BaseResponse;
import com.konne.nightmare.FastPublicOpinion.mvp.presenter.UserPresenter;
import com.konne.nightmare.FastPublicOpinion.mvp.view.IUserFragmentView;
import com.konne.nightmare.FastPublicOpinion.utils.LoadProgressDialog;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;

import butterknife.BindView;


public class UserFragment extends BaseMvpFragment<IUserFragmentView, UserPresenter> implements IUserFragmentView, View.OnClickListener {
    private PopupWindow popupWindow;
    @BindView(R.id.my_layout)
    LinearLayout my_layout;
    TextView user_type;


    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EventBus.getDefault().register(this);
    }

    @Override
    public int getLayout() {
        return R.layout.user_fragment;
    }

    @Override
    public void initView() {


    }

    @Override
    public void initData(Bundle savedInstanceState) {
        mPresenter.getInfo();
    }


    /**
     * 提供Fragment实例
     *
     * @return
     */
    public static UserFragment newInstance() {
        UserFragment fragment = new UserFragment();
        Bundle args = new Bundle();
        fragment.setArguments(args);
        return fragment;
    }

    @Subscribe(threadMode = ThreadMode.MAIN)
    public void onRedPointStateChange(MessageEvent e) {
        if (null == e) {
            return;
        }

    }

    @Override
    public LoadProgressDialog getLoadDialog() {
        return dialog;
    }

    @Override
    public void cancelLoadDialog() {
        if (dialog != null && dialog.isShowing()) {
            dialog.dismiss();
        }
    }


    @Override
    protected UserPresenter createPresenter() {
        return new UserPresenter();
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {


        }
    }


    @Override
    public void getInfo(BaseResponse<UserInfoBean.DataBean> data) {


    }
}
